/*
Author: Surpass-HC
Source: https://gitee.com/hxchuan000/clpc-1
Mail: surpass-hc@qq.com
*/
#pragma once
#include <logbase.h>
#include <genrand.h>
#include <pthread.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <queBase.h>
#include <errno.h>
#include <systime.h>
#include <sys/file.h>

typedef struct
{
    key_t key;
    int shmFd;
    int lockFd;
    queOptStruct *qasPtr;
} shmOptInfStc;

int shmOptInit(shmOptInfStc *shmPtr, key_t shmKey, queOptType shmSize, queOptType cfgRdrNbr, const char *lockFile);
int shmOptIsOk(shmOptInfStc *shmPtr);
queOptType shmOptWrite(shmOptInfStc *shmPtr, const uint8_t *buff, queOptType bsize);
queOptType shmOptRead(shmOptInfStc *shmPtr, uint8_t rpin, uint8_t *buff, queOptType bsize);
int shmOptRestRcv(shmOptInfStc *shmPtr, uint8_t rdChnl);
int shmOptFree(shmOptInfStc *shmPtr);
